package com.example.mimile_home;
import org.json.JSONException;
import org.json.JSONObject;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.io.IOException;
import java.lang.reflect.Member;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

@Controller
@RequestMapping("/")

public class mi_Home {
    sqlQueryDb db=new sqlQueryDb();
    @RequestMapping( "/home")
    public String Home() throws IOException {

        return "Home";

    }//这是一个主页文件Home.html

@RequestMapping(value = "/h",method = RequestMethod.GET)
  public List<Users> data(){
        List<Users> list=new ArrayList<Users>();
    for (int i = 0; i < 10; i++) {
        Users user = new Users();
        user.setId(i + 1);
        user.setUsername("springboot" + i);
        list.add(user);
    }

    return list;


}

    @ResponseBody
    @RequestMapping(value = "/login/{username}/{password}",method = RequestMethod.GET)
    public void login(@PathVariable String username,@PathVariable String password){
        System.out.println(username);
        System.out.println(password);
    }





}

